/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frontera;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;

/**
 *
 * @author Admin
 */
public class PanelHistoriograma extends javax.swing.JPanel {

    /**
     * Creates new form PanelHistoriograma
     */
    public PanelHistoriograma() {
        initComponents();
        //TODO: Eliminar el metodo meth que solo es de prueba y reemplazarlo por el que va a colocar el grafico con los datos dentro del panel
        
        meth();
    }
    
    private void meth(){
        // Creamos y rellenamos el modelo de datos
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();

        
        // Visitas del sitio web 1
        dataset.setValue(100, "Lunes", "Lunes");
        dataset.setValue(120, "Lunes", "Martes");
        dataset.setValue(110, "Lunes", "Miércoles");
        dataset.setValue(103, "Lunes", "Jueves");
        dataset.setValue(106, "Lunes", "Viernes");
        JFreeChart chart = ChartFactory.createBarChart3D("Hola", "Dias", "Horas", dataset, PlotOrientation.VERTICAL, true, true, false);
        
        ChartPanel panel = new ChartPanel(chart);
        this.jPanel_Grafico.add(panel);
//        this.jPanel1 = (javax.swing.JPanel) panel;
//        this.jPanel1.repaint();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup_Variables = new javax.swing.ButtonGroup();
        jRadioButton_Temperatura = new javax.swing.JRadioButton();
        jRadioButton_Pluviosidad = new javax.swing.JRadioButton();
        jRadioButton_Pres_Atmosferica = new javax.swing.JRadioButton();
        jPanel_Grafico = new javax.swing.JPanel();

        setBorder(javax.swing.BorderFactory.createTitledBorder("Historico"));

        buttonGroup_Variables.add(jRadioButton_Temperatura);
        jRadioButton_Temperatura.setText("Temperatura");

        buttonGroup_Variables.add(jRadioButton_Pluviosidad);
        jRadioButton_Pluviosidad.setText("Pluviosidad");

        buttonGroup_Variables.add(jRadioButton_Pres_Atmosferica);
        jRadioButton_Pres_Atmosferica.setText("Presión Atmosferica");

        jPanel_Grafico.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel_Grafico.setLayout(new java.awt.BorderLayout());

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jRadioButton_Temperatura)
                        .addGap(18, 18, 18)
                        .addComponent(jRadioButton_Pluviosidad)
                        .addGap(18, 18, 18)
                        .addComponent(jRadioButton_Pres_Atmosferica)
                        .addGap(0, 45, Short.MAX_VALUE))
                    .addComponent(jPanel_Grafico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton_Temperatura)
                    .addComponent(jRadioButton_Pluviosidad)
                    .addComponent(jRadioButton_Pres_Atmosferica))
                .addGap(18, 18, 18)
                .addComponent(jPanel_Grafico, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup_Variables;
    private javax.swing.JPanel jPanel_Grafico;
    private javax.swing.JRadioButton jRadioButton_Pluviosidad;
    private javax.swing.JRadioButton jRadioButton_Pres_Atmosferica;
    private javax.swing.JRadioButton jRadioButton_Temperatura;
    // End of variables declaration//GEN-END:variables
}
